import React from 'react'
import PropTypes from 'prop-types'

function ListChildren({listChildren}) {
    return (
        <div>
             {
                listChildren&&listChildren.map((val,i)=>{
                    return <div key={i}>
                        <p>title:{val.title}</p>
                        <p>id:{val.id}</p>
                    </div>
                })
            }
        </div>
    )
}

ListChildren.defaultProps = {
    listChildren:[
        {
            title:"没有数据",
            id:0
        }
    ]
}

ListChildren.propTypes = {
    listChildren: PropTypes.array.isRequired
}

export default ListChildren
